package com.ymfjc.subject.domain.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.*;

@Configuration
public class ThreadPoolConfig {

    //查询刷题分类及标签的线程池设定
    @Bean(name = "labelThreadPool")
    public ThreadPoolExecutor getLabelThreadPool(){
        return new ThreadPoolExecutor(20,100,5, TimeUnit.HOURS,new LinkedBlockingDeque<>(40), new CustomNameThreadFactory("label"),new ThreadPoolExecutor.CallerRunsPolicy());
    }
}
